//
//  File.swift
//  DemoTest
//
//  Created by admin on 2022/4/24.
//

import Foundation
import SwiftUI

struct FinalView: View {
  

    var body: some View {
        
        ZStack {
            
            BgImageView()
            
            Image("background-1")
                .resizable()
                .aspectRatio(contentMode: .fit)
                .frame(width: screen.width, height: screen.height)
            VStack {
                Image("items")
                    .resizable()
                    .aspectRatio(contentMode: .fit)
                    .frame(width: screen.width/2.2)
                    .offset(x: -screen.width / 10)
                Spacer()
            }
            VStack {
                ZStack{
                 
                        Image("w")
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .frame(width: screen.width/2.2)
                        
                 
                  
                        Image("w2")
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .frame(width: screen.width/2.2)
                
                    
                        Image("d")
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .frame(width: screen.width/2.2)
                    
                  
                        Image("c")
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .frame(width: screen.width/2.2)
                        
                        Image("22")
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                            .frame(width: screen.width/2.2)
                  
                  
                }
                Spacer()
                
            }
            .offset(x: -screen.width / 10, y: -screen.height / 16)
            
            HStack {
                Spacer()
                VStack {
                    Image("nextButton")
                        .resizable()
                        .aspectRatio(contentMode: .fit)
                        .frame(width: screen.width/8)
                        .padding(50)
                    
                    Image("sign-W")
                         .resizable()
                         .aspectRatio(contentMode: .fit)
                         .frame(width: screen.width/5)
                         .padding(50)
                    Image("signmantion")
                        .resizable()
                        .aspectRatio(contentMode: .fit)
                        .frame(width: screen.width/5)
                }
               
            }
           
            .onTapGesture {
                if let window = UIApplication.shared.windows.first {
                    window.rootViewController = UIHostingController(rootView: PassEnd())
                    window.makeKeyAndVisible()
                }
            }
        }
    }
    
}

struct BgImageView: UIViewControllerRepresentable {
    func makeUIViewController(context: Context) -> some UIViewController {
        isFinal = true
        let vc = MainViewController()
        isFinal = true
        return vc
    }
    func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {
        
    }
}




